importScripts("./xlsx.js");
console.log(XLSX);
let arr = [];
for (let i = 0; i < 100000; i++) {
  arr.push({
    id: i,
    name: `大壮${i}号`,
    location: `xxx大道${i}号`,
    age: i,
    a: i * 2,
    b: i / 2,
    c: i + 2,
    d: 22,
    e: 222,
    f: 234,
  });
}

self.addEventListener("message", () => {
  const sheet = XLSX.utils.json_to_sheet(arr);
  const workbook = XLSX.utils.book_new();
  XLSX.utils.book_append_sheet(workbook, sheet, "Sheet1");
  self.postMessage(workbook);
});
